package com.peaker.advertisingpro.db.dao

import androidx.room.*
import com.peaker.advertisingpro.bean.ProgramJsonBean
import com.peaker.advertisingpro.bean.ProgramUrlBean

/**
 * 播放列表节目json
 */
@Dao
interface ProgramListJsonDao : BaseDao<ProgramJsonBean> {

    @Query("SELECT * FROM programjsondb")
    fun getAllJson(): MutableList<ProgramJsonBean>


    @Query("SELECT * FROM programjsondb where programId  = :pid")
    fun getJsonByPId(pid:String): MutableList<ProgramJsonBean>


    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(entitie: ProgramJsonBean?)

    @Delete
    fun delete(entity: ProgramJsonBean?)

    @Update
    fun update(entity: ProgramJsonBean?)

    @Query("DELETE FROM programjsondb where programId = :pid")
    fun deletByPId(pid :String)

    @Query("DELETE FROM programjsondb")
    fun deletAll()

}